Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@thoughtindustries/content
Advanced tools
@thoughtindustries/content
A collection of content specific resources for @thoughtindustries/helium UI components. It comes with typings and React Hooks for making graphql queries and mutations, as well as utilities for content hydration.
import {
GlobalTypes,
useCatalogContentQuery,
LoadingDots,
hydrateContent
} from '@thoughtindustries/content';
// run hook to query catalog content
const { data, loading, error } = useCatalogContentQuery({
variables: {
sortColumn: GlobalTypes.SortColumn.PublishDate,
sortDirection: GlobalTypes.SortDirection.Desc,
resultsDisplayType: GlobalTypes.ContentItemDisplayType.Grid,
page: 2
},
});
// render loading dots before data is resolved
if (loading) {
return <LoadingDots />
}
// hydrate content response when data is resolved
const { i18n } = useTranslation();
if (data) {
const { contentItems = [] } = data.CatalogContent;
return contentItems.map((item, index) => {
const hydratedItem = hydrateContent(i18n, item);
// render component for hydrated content item
// return ...
});
}
The Content Header
component is used to display the title
, description
, and image
of a Course or Learning Path. All content types, except learning paths, can also display rating
and ratingsCount
information.
import { ContentHeader } from '@thoughtindustries/content';
export function MyComponent() {
// ...
return (
<ContentHeader contentKind={contentKind} slug={courseSlug} showStars={true} showImage={true} />
);
}
Name | Required | Type | Description |
---|---|---|---|
contentKind | Yes | string | The contentKind of the Content, e.g., learningPath , course . |
slug | Yes | slug | The slug of the content that should be displayed. |
showStars | No | boolean | Controls whether a course's rating is displayed, shown in stars. |
showImage | No | boolean | Controls whether a piece of content's Detail Image is displayed. |
FAQs
> TODO: description
We found that @thoughtindustries/content demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.